package guessNumber;

import java.io.Serializable;
import java.util.Random;


public class UserNumberBean implements Serializable {

	private static final long serialVersionUID = 1L;
	

	Integer randomInt = null;
	Integer userNumber = null;
	String response = null;
	private long maximum = 10;
	private long minimum = 0;
	
	public UserNumberBean()
	{
		// initialize randomInt field value
		Random randomGR = new Random();
		randomInt = new Integer(randomGR.nextInt(10));
		System.out.println("Number : " + randomInt);
	}
	
	public Integer getUserNumber() {
		return userNumber;
	}

	public void setUserNumber(Integer userNumber) {
		this.userNumber = userNumber;
	}

	public long getMaximum() {
		return maximum;
	}

	public void setMaximum(long maximum) {
		this.maximum = maximum;
	}

	public long getMinimum() {
		return minimum;
	}

	public void setMinimum(long minimum) {
		this.minimum = minimum;
	}

	public String getResponse() {
		if ( (userNumber != null) && (userNumber.compareTo(randomInt) == 0 ) )
		{
			return "Yay! You got it!";
		}
		else
		{
			return "Sorry, " + userNumber + " is incorrect...";
		}
	}

}
